/*
 * This Smart Framework helps in developing the project very easily with Dynamic Injection, 
 * Dynamic Lookup. This framework provides the developer to create factory classes and implement 
 * the DAO, Service, etc..
 * Copyright (C) 2011  R.Satheesh Kumar alias GURU
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * EmailId: pulsarcoder@gmail.com
 */
package org.jsmart.context.support;

import org.jsmart.context.ApplicationContext;
import org.jsmart.factory.exception.FactoryException;
import org.jsmart.factory.beans.listener.BeanListener;
import javax.servlet.ServletContext;
import java.util.Set;
import java.util.HashSet;

/**
 * This class is used as the data transfer object 
 * for providing the constructor argument for bean object
 * @author R.Satheesh Kumar alias guru
 * @version 1.0-a
 * @since 29-12-2011
 * @see ApplicationContext
 * @see FactoryException
 * @see BeanListener
 * @see Set
 * @see HashSet
 * @see ServletContext
 */
public abstract class AbstractApplicationContext<k, T> implements ApplicationContext<k, T> {
	protected ServletContext servletContext;
	protected Set<T> beans = new HashSet<T>();
	protected Set<BeanListener> beanListener = new HashSet<BeanListener>();
	
	@Override
	public abstract void loadFactory() throws FactoryException;

	@Override
	public void setServletContext(ServletContext servletContext) {
		this.servletContext = servletContext;
	}
	
}
